1. Field of the Invention
The present invention relates to a measurement system, an image correction method, and a computer program. More specifically, the present invention is applicable to a system performing three-dimensional measurement based on captured images.
2. Description of the Related Art
The three-dimensional measurement is a technique playing an important role in the machine vision field. A conventional three-dimensional measurement method includes capturing an image of a pattern projection image with a camera, for example, by irradiating a measurement target with two-dimensional pattern light. The conventional three-dimensional measurement method further includes obtaining measurement target distance information by performing a computer-based analysis on a captured two-dimensional image based on the periodicity of the two-dimensional pattern.
The distance information represents the distance of the measurement target in the depth direction, such as the distance between the measurement target and the camera, or surface undulation. Information relating to the measurement target in the width direction or the height direction can be obtained based on the captured two-dimensional image. Therefore, at this moment, it is feasible to obtain three-dimensional space information.
The conventional three-dimensional measurement method further includes performing three-dimensional model fitting based on the captured two-dimensional image, the distance information, and preliminarily stored model information of the measurement target, to acquire measurement information (e.g., position, orientation, and three-dimensional shape) relating to the measurement target.
A method using two-dimensional pattern light to obtain the distance information relating to the measurement target in the depth direction is generally referred to as a pattern projection method. In general, the pattern projection method includes irradiating a measurement target with edge pattern or sine wave pattern light.
The edge pattern is a discrete pattern including binary (e.g., monochrome) gradational stripes that are regularly and continuously arranged. The sine wave pattern is a continuous pattern that expresses gradational sine waves that continuously vary in gradation.
If a measurement target is irradiated with two-dimensional pattern light, the discontinuity or distortion of the pattern depending on the surface undulation or the shape of the measurement target can be observed. In the case of using the edge pattern light, the discontinuity corresponds to an edge positional deviation. In the case of using the sine wave pattern light, the distortion corresponds to a phase deviation.
In the case of using the edge pattern light, the principle of triangulation is usable to estimate the distance of a measurement target in the depth direction based on an edge positional deviation. Therefore, the accuracy of edge recognition for accurately recognizing an edge position has influence on the accuracy of the distance of the measurement target in the depth direction.
Similarly, in the case of using the sine wave pattern light, the principle of triangulation is usable to estimate the distance of a measurement target in the depth direction based on a phase deviation. Therefore, the accuracy of gradation recognition for accurately recognizing a phase (i.e., gradation) has influence on the accuracy of the distance of the measurement target in the depth direction.
In the edge recognition, an edge position can be recognized based on a luminance difference in the binary gradation or a luminance change process. It can be regarded that the luminance continuously varies in a transitional area where the gradation of an edge portion reverses. An unintended luminance change of two-dimensional pattern light randomly changes the route of the above-described transitional luminance change or the position where the gradation saturates.
Therefore, an unintended luminance change (luminance unevenness) of two-dimensional pattern light may occur and the generated luminance change may decrease the accuracy of the edge recognition. Similarly, the luminance change (luminance unevenness) of two-dimensional pattern light may decrease the accuracy of the gradation recognition.
As discussed in Japanese Patent Application Laid-Open No. 06-242020, there is a conventional technique capable of suppressing the above-described luminance change (luminance unevenness) of a two-dimensional pattern. When an illumination device is placed obliquely on one side of a surface to be inspected, the intensity of reflection light and a charge-coupled device (CCD) output do not become uniform even if the surface to be inspected is a uniform surface.
To solve this problem, the technique discussed in Japanese Patent Application Laid-Open No. 06-242020 changes an emission intensity ratio of illumination light based on a distance ratio of both ends of the surface to be inspected relative to a light emission face of the illumination device.
However, according to the technique discussed in Japanese Patent Application Laid-Open No. 06-242020, the setup position of the illumination device is variable relative to the surface to be inspected, while the position of a CCD camera is fixed in position relative to the surface to be inspected.
As described above, according to the technique discussed in Japanese Patent Application Laid-Open No. 06-242020, the CCD camera is fixed in position and, therefore, that technique is not robust against the lack in light quantity or deterioration of image, which may derive from occlusion or the spatial position of the illumination device.
Similarly, due to its inherent configuration, the technique discussed in Japanese Patent Application Laid-Open No. 06-242020 cannot correct a luminance change derived from the positional relationship in an imaging system, although it is effective to correct a luminance change derived from the positional relationship in an illumination system.